<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>系统提示信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#contentTable tbody tr").click(function(e){
				if (!this.id) {
					return;
				}
				$("#contentTable tbody tr").removeClass("select_active");
				$(this).addClass("select_active");
				sessionStorage.parentPageNo = $("#pageNo").val();
				loginPasswordPopup('${ctx}/message/systemNotifyMessage/detail?msgId=' + this.id);
			});
			var currentSelectId = '${currentSelectId}';
			if(currentSelectId){
				$("#"+currentSelectId).addClass("select_active");
			} else {
				$("#contentTable tbody tr:first-child").addClass("select_active");
			}
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<div class="icon-buttons">
		<input type="button" class="leave-clean-session" data-inline="true" data-icon="back" data-iconpos="notext" value="返回"/>
	</div>
	<form:form id="searchForm" modelAttribute="systemNotifyMessage" action="${ctx}/message/systemNotifyMessage/companyMsg" method="post">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	</form:form>
	<tags:message content="${message}"/>
	<h3 class="middleCls">消息列表</h3>
	<div class="form-input">
		<table id="contentTable"  data-role="table" class="ui-responsive table-stroke">
			<thead><tr><th>通知日期</th><th>消息类型</th><th>状态</th></tr></thead>
			<tbody>
			<c:if test="${empty page.list}">
				<tr>
					<td colspan="3">无通知</td>
				</tr>
			</c:if>
			<c:if test="${not empty page.list}">
				<c:forEach items="${page.list}" var="detail">
					<tr id="${detail.systemNotifyMessage.id}">
						<td>${fns:formatDate(detail.systemNotifyMessage.beginDate, "yyyy-MM-dd")}</td>
						<td>${fns:getDictLabel(detail.systemNotifyMessage.type, 'message_type', '')}</td>
						<td>${fns:getDictLabel(detail.status, 'message_status', '')}</td>
					</tr>
				</c:forEach>
			</c:if>
			</tbody>
		</table>
		<div class="pagination">${page}</div>
	</div>
</body>
</html>
